package com.mma.assigment_registrationform;

public class UserAccount {

	private int UID = 0;

	private String userName;
	private String password;
	private String eMail;

	private int age;
	private String address;

	private String accountType;

	public UserAccount() {
		this.accountType = "admin";
	}

	public UserAccount(String userName, String password, String eMail) {
		this.userName = userName;
		this.password = password;
		this.eMail = eMail;
		this.accountType = "user";
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String geteMail() {
		return eMail;
	}

	public void seteMail(String eMail) {
		this.eMail = eMail;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getUID() {
		return UID;
	}

	public void setUID(int uID) {
		if (UID == 0) {
			UID = uID;
		}
	}

	public boolean isAdmin() {
		if (accountType.equalsIgnoreCase("admin")) {
			return true;
		} else {
			return false;
		}
	}

	public boolean isModerator() {
		if (accountType.equalsIgnoreCase("moderator")) {
			return true;
		} else {
			return false;
		}
	}

	public boolean isUser() {
		if (accountType.equalsIgnoreCase("user")) {
			return true;
		} else {
			return false;
		}
	}

	public void setAdmin(boolean isSetToAdmin) {
		if (isSetToAdmin) {
			this.accountType = "admin";
		} else {
			this.accountType = "user";
		}
	}
}
